CC = gcc
CXX = g++
#OPT = -g
OPT = -Wall -O3

psvn2c: psvn2c.cpp psvn2c.hpp psvn.cpp psvn.hpp
	$(CXX) $(OPT) psvn2c.cpp psvn.cpp -o $@

%.c: %.psvn psvn2c psvn2c_common.c
	./psvn2c < $< > $@

%.bfs: %.c bfs.cpp
	$(CXX) $(OPT) bfs.cpp -include $< -o $@

%.bootstrap: %.c bootstrap.c
	$(CC) $(OPT) bootstrap.c -include $< -o $@

%.solver: %.c solver.c
	$(CC) $(OPT) solver.c -include $< -o $@

absgen: abstgenerator.cpp psvn.cpp
	$(CXX) $(OPT) abstgenerator.cpp psvn.cpp -o absgen

learning: linreg.cpp
	$(CXX) $(OPT) -lgsl -lgslcblas linreg.cpp -o linreg

clean:
	rm -f psvn2c
